﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DBProvider.Providers
{
	public interface IUserProvider
	{
		User CreateUser(User theNewUser, out string msg);
		bool DeleteUser(int userID);
		bool UpdateUser(User u, bool setPwd);
		User GetUser(int userID, bool loadRelation);
		User GetUser(string userName);
		List<User> GetAllUser();
		List<User> GetAllUser(int pageIndex, int pageSize, out int totalRecords);
		List<User> GetUserByGroup(int groupID);
		List<User> GetUserByGroup(int groupID, int pageIndex, int pageSize, out int totalRecords);
		bool ValidUser(string userName, string pwd, out string msg);
		bool ResetPassword(User theUser);

		List<User> GetUserByRole(string roleName, int drugStoreID);
		List<User> GetUserByDrugStore(int drugStoreID, bool onlyActive);
		List<User> GetUserByDrugStore(int drugStoreID, bool onlyActive, int pageIndex, int pageSize, out int totalRecords);

		Role GetRole(string roleName);
		List<Role> GetAllRole();
	}
}
